package ym.ecrm.web.action.systemManagement;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;

import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;

import ym.ecrm.core.common.exception.MessageException;
import ym.ecrm.core.dto.systemManagement.UserDTO;
import ym.ecrm.core.service.systemManagement.ISystemService;
import ym.ecrm.core.service.systemManagement.impl.SystemService;
import ym.ecrm.web.action.base.BaseAction;

public class LoadUserInfoAction extends BaseAction{

	private Long userId;
	private UserDTO userDTO;
	
	@Autowired
	private ISystemService systemService;
	
	public String execute(){
//		Long userId = (Long) ActionContext.getContext().getSession().get("user");
		if(userId != null){
			userDTO = systemService.loadUser(userId);
		}
		return proccess();
	}
	
	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public void setUserDTO(UserDTO userDTO) {
		this.userDTO = userDTO;
	}

	public String getSuccess(){
		return success;
	}

	public void setSuccess(String success) {
		this.success = success;
	}

	public UserDTO getUserDTO() {
		return userDTO;
	}

}